const app = getApp();
Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    mod:null,
    TabCur: 0,
    checkList:[],
    list:[]
  },
  onReady: function () {
    this.setData({
        list:[
            {
              id:'1',
              template:'YS001', //阳上001号模板
              name:'姓名',
              amount:100,
              family:'合家',
              type:'ys',
              paid:true
            },
            {
              id:'2',
              template:'WS001', //往生001号模板
              name:'姓名',
              amount:100,
              type:'ws',
              family:'合家累劫云',
            },
      
          ]
    })
  },
  tabSelect(e) {
    this.setData({
      TabCur: e.currentTarget.dataset.id,
      list:[],
      checkList:[]
    })
    console.log(e.currentTarget.dataset.id)
    let id = e.currentTarget.dataset.id
    if(id == 0){
        this.setData({
            list:[
                {
                  id:'1',
                  template:'YS001', //阳上001号模板
                  name:'姓名',
                  amount:100,
                  family:'合家',
                  type:'ys',
                  paid:true
                },
                {
                  id:'2',
                  template:'WS001', //往生001号模板
                  name:'姓名',
                  amount:100,
                  type:'ws',
                  family:'合家累劫云',
                },
              ],
        })
    }else if(id == 1){
        this.setData({
            list:[
                {
                  id:'1',
                  template:'YS001', //阳上001号模板
                  name:'姓名',
                  amount:100,
                  family:'合家',
                  type:'ys',
                  paid:true
                },
                {
                  id:'2',
                  template:'WS001', //往生001号模板
                  name:'姓名',
                  amount:100,
                  type:'ws',
                  family:'合家累劫云',
                },
                {
                    id:'3',
                    template:'WS001', //往生001号模板
                    name:'姓名',
                    amount:100,
                    type:'ws',
                    family:'合家累劫云',
                  },
              ]
        })
    }else{
        this.setData({
            list:[]
        })
    }
  },
    switchColor(e){
        switch(e){
            case 'YS001':
                return 'var(--gradualOrange)'
            break;
        }
    },
    setting(e){
        console.log(e.currentTarget.dataset.mod)
        wx.showToast({
            title:'设置成功'
        })
    },
  showModal(e) {
    this.setData({
      modalName: e.currentTarget.dataset.target
    })
  },
  hideModal(e) {
    this.setData({
      modalName: null
    })
  },
  switchSex: function (e) {
    this.setData({
      skin: e.detail.value
    });
  },
  Delete(e){
    console.log(this.checkList)
    
  },
  checkboxChange(e){
      this.checkList = e.detail.value
    console.log(e.detail.value)
  }
})